<script type="text/javascript">
    $(function () {
        var pjsflxType = $("#pj_search_pjsflx").val();
        $("#pj_search_grid").edatagrid({
            url:$.webPath() + "/zjgl/pjgl/pjglwsyList?pjsflxType="+pjsflxType,
            fitColumns:true,
            singleSelect:false,
            pagination:true,
            fit:true,
            rownumbers:true,
            columns: [
                [
                    {field: 'checked', checkbox: true},
                    {field:'id', title:'ID', hidden:true},
                    {field:'pjhm', title:'票据号码', width:20,align: 'center'},
                    {field:'cpyh_qc', title:'出票行', width:40,align: 'center'},
                    {field:'spr_jc', title:'收票人', width:40,align: 'center'},
                    {field:'dqje', title:'票据金额', width:20, formatter:function(value){
                        var sl = formatJe2(value,",");
                        return sl;
                    },align: 'right'},
                    {field:'dqr', title:'到期日', width:20,align: 'center'},
                    {field:'bz', title:'备注', width:20,align: 'center'}
                ]
            ]
        });
    })
    $("#pj_search_pjsflx").change(function (oldValue,newValue) {
        var pjsflxType = $("#pj_search_pjsflx").val();
        $("#pj_search_grid").edatagrid({
            url:$.webPath() + "/zjgl/pjgl/pjglwsyList?pjsflxType="+pjsflxType,
            fitColumns:true,
            singleSelect:false,
            pagination:true,
            fit:true,
            rownumbers:true,
            columns: [
                [
                    {field: 'checked', checkbox: true},
                    {field:'id', title:'ID', hidden:true},
                    {field:'pjhm', title:'票据号码', width:20,align: 'center'},
                    {field:'cpyh_qc', title:'出票行', width:40,align: 'center'},
                    {field:'spr_jc', title:'收票人', width:40,align: 'center'},
                    {field:'dqje', title:'票据金额', width:20, formatter:function(value){
                        var sl = formatJe2(value,",");
                        return sl;
                    },align: 'right'},
                    {field:'dqr', title:'到期日', width:20,align: 'center'},
                    {field:'bz', title:'备注', width:20,align: 'center'}
                ]
            ]
        });
    });
</script>
<div id="layout_pj_search" class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center'">
        <div id="toolbar_jkd_search">
            <div class="textcon">
                <table class="tb">
                    <tr>
                        <th>票据收付类型：</th>
                        <td><select id="pj_search_pjsflx" class=" input-text" style="width: 80px">
                            <option value="0" selected="selected">应收票据</option>
                            <option value="1">应付票据</option>
                        </select>
                    </tr>
                </table>
            </div>
        </div>
        <table id="pj_search_grid"></table>
    </div>
</div>